package com.lianxi.utils;

import org.junit.Test;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
    public static Timestamp getTime(){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date=new Date();
        String format = sdf.format(date.getTime());
        Timestamp timestamp = Timestamp.valueOf(format);
        return timestamp;
    }
}
